package com.itheima.jdbc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author CC小天才
 * @website www.flyskill.cn
 * @date 2021/10/13 22:30
 **/

public class addAccountTest {

    ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
    AccountDao accountDao= (AccountDao) applicationContext.getBean("accountDao");
    Account account=new Account();
    account.setUsername("tom");
    account.setBalance(1000.00);
    int num =accountDao.addAccount(account);
    if(num>0){
        System.out.println("成功插入了"+num+"条数据!");
    }else{
        System.out.println("插入失败！");
    }
}
